package com.ass.elasticsearch.page;

import lombok.Getter;
import lombok.Setter;
import org.dromara.easyes.core.biz.EsPageInfo;

import javax.validation.constraints.Min;

@Getter
@Setter
public class EsPageInput {

    //每页几条
    @Min(1)
    private int offset;

    //当前页码
    @Min(1)
    private int current;

    public final <T> EsPageInfo<T> getPage() {
        EsPageInfo<T> tEsPageInfo = new EsPageInfo<>();
        tEsPageInfo.setPageNum(current);
        tEsPageInfo.setSize(offset);
        return tEsPageInfo;
    }


}
